/*
 * @Description: 设置页demo
 * @Author: HuiSir<273250950@qq.com>
 * @Date: 2025-06-22 19:28:01
 * @LastEditTime: 2025-08-12 00:04:17
 */
import { defineFormOptions } from "@/ui";
import {
  useFormUploadProp,
  richEditorUploadImageConfigMixin,
} from "@/helpers/optionsMixin";

export default defineFormOptions(() => [
  {
    label: "系统名称",
    component: "input",
    key: "name",
    desc: "这是表单项的说明文本",
    props: {
      placeholder: "请输入名称",
    },
    rules: {
      required: true,
    },
  },
  {
    label: "图片上传路径",
    component: "input",
    key: "picUploadPath",
    props: {
      placeholder: "请输入路径",
    },
    rules: {
      required: true,
    },
  },
  {
    label: "文件上传路径",
    component: "input",
    key: "fileUploadPath",
    props: {
      placeholder: "请输入路径",
    },
    rules: {
      required: true,
    },
  },
  {
    label: "站点语言",
    component: "radio",
    key: "language",
    options: [
      {
        label: "简体中文",
        value: 1,
      },
      {
        label: "繁体中文",
        value: 2,
      },
      {
        label: "英文",
        value: 3,
      },
    ],
  },
  {
    label: "管理员默认密码",
    component: "input",
    key: "defaultPassword",
    props: {
      type: "password",
      autocomplete: "new-password",
      showPassword: true,
      placeholder: "请输入默认密码",
    },
    rules: {
      required: true,
    },
  },
  {
    label: "允许管理员修改密码",
    component: "switch",
    key: "canResetPassword",
    props: {
      activeText: "允许",
      inactiveText: "不允许",
      activeValue: 1,
      inactiveValue: 0,
    },
  },
  {
    label: "侧栏",
    component: "select",
    key: "sidebar",
    props: {
      placeholder: "选择侧栏配置",
    },
    options: [
      {
        label: "始终展示",
        value: "1",
      },
      {
        label: "自动隐藏",
        value: "2",
      },
      {
        label: "不展示",
        value: "3",
      },
    ],
  },
  {
    label: "单图上传",
    component: "upload",
    key: "up1",
    props: useFormUploadProp({
      limit: 1,
      accept: "image/png,image/jpeg,image/gif,image/svg+xml",
      listType: "picture-card",
      allowUrlInsert: false,
    }),
    rules: {
      required: true,
    },
  },
  {
    label: "多图上传",
    component: "upload",
    key: "up2",
    props: useFormUploadProp({
      accept: "image/png,image/jpeg,image/gif,image/svg+xml",
      listType: "picture-card",
      limit: 3,
    }),
    inputWidth: 800,
    rules: {
      required: true,
    },
  },
  {
    label: "文件上传",
    component: "upload",
    key: "up3",
    props: useFormUploadProp({
      limit: 3,
    }),
    inputWidth: 600,
    desc: "允许上传2M的文件",
    rules: {
      required: true,
    },
  },
  {
    label: "关于本站",
    component: "richEditor",
    key: "about",
    inputWidth: 800,
    props: {
      uploadImageConfig: richEditorUploadImageConfigMixin,
    },
  },
]);
